<!DOCTYPE html>
<html>
    <head>
        <title>ch02-shapes</title>
    </head>
    <body>
        <div id="container"></div>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
        <script>
// Raphael(container, width. height, callback) or ...
var paper = Raphael("container", 1000, 800);
//
var mysquare = paper.rect(25, 25, 250, 250).attr("fill", "red");

function turnMeBlue(e) {
   var color = this.attr("fill");
   this.attr("fill", color=="blue"?"red":"blue");
}

mysquare.click(turnMeBlue);
//
window.setTimeout(function(){
    // R=rotate,指定转轴点的xy
    //r3.attr("transform", "R90,680,60");
}, 2000);


		
		
		</script>
    </body>
</html>